package com.cib.process.chat.core.policy;

import com.cib.process.bean.Actions;
import org.apache.commons.lang.StringUtils;

public class ActionErrorPolicyFactory {
    public static AbstractActionErrorPolicy getPolicy(String lastAction) {
        if (StringUtils.isNotBlank(lastAction)){
            Actions actions = Actions.instanceOf(lastAction);
            if (actions==null){
                switch (actions){
                    case PWD:
                        return new CheckPaswdErrorPolicy();
                }
            }

        }
        return new NoneActionErrorPolicy();
    }
}
